You will be glad to know that the index you just created can be used in any of the approaches described in this article to fetch data from the database into the business logic. 对于本文描述的把数据库数据提取到业务逻辑中的所有方式,都可以使用刚才创建的索引。
If you want to support other queries, add whatever logic you need to the fetch function. 如果您想支持其他查询,向fetch函数添加任何您需要的逻辑。
If an application is using max-elements, you will need to modify the code; one possible modification is to write appropriate logic in a facade to FETCH FIRST n ROWS from the result set. 如果应用程序使用max-elements,则需要修改代码;一种可能的修改方法是在一个Facade中编写适当的逻辑来从结果集中获取前n行(FETCHFIRSTnROWS)。